<?php

namespace app\teacher\controller\v1;

use app\common\controller\BaseController;
use app\teacher\model\Language as LanguageModel;
use app\teacher\model\LanguageGrade as LanguageGradeModel;
use app\teacher\model\Stage as StageModel;
use app\teacher\model\Speaking as SpeakingModel;

class Language extends BaseController
{
    /**
     * 语种
     */
    public function index()
    {
        $languages = LanguageModel::getOnline();
        $this->success('', compact('languages'));
    }

    /**
     * 语种等级
     */
    public function grade()
    {
        $languageId = $this->notEmpty('language_id');
        $grade = LanguageGradeModel::getByLanguageId($languageId);
        $this->success('', compact('grade'));
    }

    /**
     * 授课阶段
     */
    public function stage()
    {
        $stage = StageModel::all();
        $this->success('', compact('stage'));
    }

    /**
     * 授课语言
     */
    public function speaking()
    {
        $speaking = SpeakingModel::all();
        $this->success('', compact('speaking'));
    }

}
